Skip to content

fix: add 'run' subcommand to Dockerfile CMD after clap migration#335

Merged
thepagent merged 1 commit intoopenabdev:mainfrom
dogzzdogzz:fix/dockerfile-clap-cmd
Apr 14, 2026
Merged

fix: add 'run' subcommand to Dockerfile CMD after clap migration#335
thepagent merged 1 commit intoopenabdev:mainfrom
dogzzdogzz:fix/dockerfile-clap-cmd

Conversation

@dogzzdogzz
Copy link
Copy Markdown
Contributor

@dogzzdogzz dogzzdogzz commented Apr 14, 2026

What problem does this solve?

After #191 added clap CLI with subcommands, all Dockerfiles still pass the config path as a positional argument, breaking every Docker/K8s deployment on v0.7.4+.

error: unrecognized subcommand '/etc/openab/config.toml'

Closes #334

At a Glance

ENTRYPOINT ["openab"]
CMD ["/etc/openab/config.toml"]          ← clap sees this as subcommand name
     ↓ fix
CMD ["run", "/etc/openab/config.toml"]   ← clap routes to Commands::Run

Prior Art & Industry Research

OpenClaw: Uses CMD ["node", "dist/main.js"] — no subcommands, not applicable.

Hermes Agent: Uses CMD ["python", "-m", "hermes_agent"] — no subcommands, not applicable.

Neither project uses a Rust clap-style CLI with subcommands in Docker, so there's no prior art to draw from. This is a straightforward Docker CMD compatibility fix.

Proposed Solution

Change CMD in all 5 Dockerfiles from ["/etc/openab/config.toml"] to ["run", "/etc/openab/config.toml"].

Why this approach?

The only correct fix — the clap CLI requires the run subcommand before the config path. No other options.

Alternatives Considered

  • Make config path a global argument instead of subcommand-specific: Would require changing clap CLI structure in main.rs — much larger change for the same result.
  • Default subcommand without explicit run: Already implemented (unwrap_or(Commands::Run { config: None })), but only works when no arguments are passed. A positional arg is always interpreted as a subcommand name by clap.

Validation

  • cargo check passes
  • cargo test passes (40 tests)
  • Manual testing: docker run openab:latest now starts correctly with /etc/openab/config.toml

🤖 Generated with Claude Code

After openabdev#191 added clap CLI with subcommands, the Dockerfiles still passed
the config path as a positional argument, which clap interprets as an
unknown subcommand:

  error: unrecognized subcommand '/etc/openab/config.toml'

Fix: CMD ["/etc/openab/config.toml"] → CMD ["run", "/etc/openab/config.toml"]

Fixes openabdev#334

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dogzzdogzz dogzzdogzz requested a review from thepagent as a code owner April 14, 2026 16:09
Copy link
Copy Markdown
Collaborator

@chaodu-agent chaodu-agent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved.

Straightforward fix — adds the missing run subcommand to all 5 Dockerfiles after the clap migration in #191. This is the only correct fix; the change is minimal and zero-risk.

Reviewed by 超渡法師 🙏

@thepagent thepagent merged commit 328ab10 into openabdev:main Apr 14, 2026
1 check passed
chengli pushed a commit to chengli/openab that referenced this pull request Apr 15, 2026
When max_sessions > 1, each session gets an isolated workspace at
{working_dir}/sessions/{thread_id}. Strategy:
- Try git clone --local first (for git repo working dirs)
- Fallback to mkdir (for PV-mounted dirs without git)

Workspace lifecycle: created on session spawn, cleaned up on
idle timeout and shutdown.

Only patch on top of upstream v0.7.5. Dockerfile CMD fix no longer
needed (upstream fixed in 0.7.5 via PR openabdev#335).

Fork drift: 1 patch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dogzzdogzz added a commit to dogzzdogzz/openab that referenced this pull request Apr 15, 2026
Resolve conflicts:
- format.rs: keep shorten_thread_name (ours), remove truncate_chars
  (upstream removed it in favor of tail-priority truncation)
- adapter.rs: replace truncate_chars with tail-priority truncation
  (keep last N chars during streaming, matching upstream's approach)
- discord.rs: keep our refactored DiscordAdapter version (upstream
  changes to compose_display/tool collapse are in their monolithic
  discord.rs which we replaced)
- Dockerfiles: upstream merged our openabdev#335 fix + added procps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pahud added a commit that referenced this pull request Apr 15, 2026
CMD now uses 'run' subcommand to match #335 fix applied to other Dockerfiles.
pahud pushed a commit to wangyuyan-agent/openab that referenced this pull request Apr 15, 2026
…elm chart

- Fix CMD to use 'run' subcommand (matches openabdev#335 fix for other Dockerfiles)
- Add opencode variant to build.yml (build-image, merge-manifests, promote-stable)
- Add opencode to docker-smoke-test.yml
- Add commented-out opencode preset example in Helm values.yaml
pahud pushed a commit to wangyuyan-agent/openab that referenced this pull request Apr 15, 2026
…elm chart

- Fix CMD to use 'run' subcommand (matches openabdev#335 fix for other Dockerfiles)
- Add opencode variant to build.yml (build-image, merge-manifests, promote-stable)
- Add opencode to docker-smoke-test.yml
- Add commented-out opencode preset example in Helm values.yaml
thepagent added a commit to wangyuyan-agent/openab that referenced this pull request Apr 15, 2026
…elm chart

- Fix CMD to use 'run' subcommand (matches openabdev#335 fix for other Dockerfiles)
- Add opencode variant to build.yml (build-image, merge-manifests, promote-stable)
- Add opencode to docker-smoke-test.yml
- Add commented-out opencode preset example in Helm values.yaml
thepagent added a commit to wangyuyan-agent/openab that referenced this pull request Apr 15, 2026
…elm chart

- Fix CMD to use 'run' subcommand (matches openabdev#335 fix for other Dockerfiles)
- Add opencode variant to build.yml (build-image, merge-manifests, promote-stable)
- Add opencode to docker-smoke-test.yml
- Add commented-out opencode preset example in Helm values.yaml
thepagent added a commit to wangyuyan-agent/openab that referenced this pull request Apr 15, 2026
…elm chart

- Fix CMD to use 'run' subcommand (matches openabdev#335 fix for other Dockerfiles)
- Add opencode variant to build.yml (build-image, merge-manifests, promote-stable)
- Add opencode to docker-smoke-test.yml
- Add commented-out opencode preset example in Helm values.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Dockerfiles pass config path as subcommand after clap migration

3 participants